package com.du.springmvc.controller;

import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;

/**
 * @author : DuJiabao
 * @Date : 2021/3/29 20:18
 * @Project : spring-mvc
 * @File : null.java
 * @Desc :
 */
@Controller
public class RestController {
  /**
   * 筛选请求方式为GET的
   *
   * @return
   */
  @RequestMapping(value = "/submit", method = RequestMethod.GET)
  String getMethod() {
    System.out.println("getMethod");
    return "hello";
  }

  /**
   * 筛选请求方式为POST的
   *
   * @return
   */
  @RequestMapping(value = "/submit", method = RequestMethod.POST)
  String postMethod() {
    System.out.println("postMethod");
    return "hello";
  }

  /**
   * 筛选请求方式为DELETE的
   *
   * @return
   */
  @RequestMapping(value = "/submit", method = RequestMethod.DELETE)
  String deleteMethod() {
    System.out.println("deleteMethod");
    return "hello";
  }

  /**
   * 筛选请求方式为PUT的
   *
   * @return
   */
  @RequestMapping(value = "/submit", method = RequestMethod.PUT)
  String putMethod() {
    System.out.println("putMethod");
    return "hello";
  }
}
